package com.boy.tool.utils;

import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.Random;

/**
 * @author whd
 * @date 2024/05/23 17:03:06
 */

public class IdGenerator {
    public Long next() {
        Random random = new Random();
        Long randomNumber = random.nextLong();
        Date date = new Date();
        Long time = date.getTime();
        String id = (time + "" + randomNumber).substring(0, 16);
        return Long.getLong(id);
    }
}
